import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter2/common/values/values.dart';

Widget buttonWidget({
  required VoidCallback onPressed,
  double width = 140,
  double height = 44,
  String title = 'Button',
  Color color = AppColors.primaryElementText,
  Color bgColor = AppColors.primaryElement,
}) {
  return Container(
    width: width,
    height: height,
    child: TextButton(
      onPressed: onPressed,
      style: ButtonStyle(
        shape: MaterialStateProperty.all<RoundedRectangleBorder>(
          RoundedRectangleBorder(
            borderRadius: Radii.r6px,
          ),
        ),
        backgroundColor: MaterialStateProperty.all(bgColor),
      ),
      child: Text(
        title,
        textAlign: TextAlign.center,
        style: TextStyle(
          color: color,
          fontSize: 18,
          fontWeight: FontWeight.w400,
          fontFamily: 'Montserrat',
          height: 1
        ),
      ),
    ),
  );
}
